package com.snail.service;

import com.snail.dto.CartDTO;
import com.snail.entity.ProductInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * @Author 【swg】.
 * @Date 2017/12/8 10:15
 * @DESC
 * @CONTACT 317758022@qq.com
 */
public interface ProductService {
    ProductInfo save(ProductInfo productInfo);
    /*根据商品的id获取商品信息*/
    ProductInfo findProductById(String productId);
    /*获取所有商家商品*/
    List<ProductInfo> findAllUpProducts();
    /*查询所有商品(分页)*/
    Page<ProductInfo> findAll(Pageable pageable);
    //加库存
    void increaseStock(List<CartDTO> cartDTOList);
    //减库存
    void decreaseStock(List<CartDTO> cartDTOList);
    //上架
    ProductInfo onSale(String productId);

    //下架
    ProductInfo offSale(String productId);
}
